import 'package:flutter/material.dart';

class chooseButton extends StatelessWidget {
  chooseButton({
    required this.isActive,
    required this.text,
    required this.listNumber,
    required this.onPressed,
  });

  final int isActive;
  final String text;
  final int listNumber;
  final void Function() onPressed;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 60,
      margin: EdgeInsets.symmetric(horizontal: 5),
      padding: EdgeInsets.symmetric(vertical: 2 ),
      child: TextButton(
        onPressed: onPressed,
        style: ButtonStyle(
          backgroundColor: isActive == listNumber
              ? MaterialStateProperty.all(Color(0xff0927eb))
              : MaterialStateProperty.all(Colors.transparent),
          shape: MaterialStateProperty.all(
            RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(25),
            ),
          ),
        ),
        child: Text(
          text,
          style: TextStyle(
            color: isActive == listNumber ? Colors.white : Colors.black,
            fontSize: 14,
          ),
        ),
      ),
    );
  }
}
